package string;

import org.junit.jupiter.api.Test;

import java.util.*;

/**
 * @Author 郅占伟
 * @ClassName TypeCast
 * @Description: TODO
 * @Date 2023年11月27日
 * @Version: 1.0
 */
public class TypeCast {

    @Test
    public void devanning(){
        // 基本数据类型转为包装器类型
        int i = 100;
        Integer i1 = Integer.valueOf(i);

        // 包装器类型转为基本数据类型
        Integer i2 = 200;
        int i3 = i2;
        System.out.println("i3的值是：" + i3);

        System.out.println(i1 == i2);
    }

    public static void main(String[] args) {
       Hashtable<String,String> hashtable = new Hashtable<>();
       hashtable.put(null,"null");
       System.out.println(hashtable);

        HashMap<String,String> hashMap = new HashMap<>();
        hashMap.put(null,"null");
        System.out.println(hashMap);

    }

    /**
     * @Author 郅占伟
     * @Description //TODO
     * @MethodName testStringJoiner
     * @Date 21:35 2024/1/1
    */
    @Test
    public void testStringJoiner(){
        String s = "539988501060386816";
        StringJoiner stringJoiner = new StringJoiner("+");
        List<String> list = new ArrayList<>();
        for (int i = 0; i < s.length() ; i++ ){
         list.add(s.charAt(i) + "");
        }
        list.forEach(s1 -> {
            stringJoiner.add(s1);
        });
        System.out.println(stringJoiner);
    }


    public static void changeValue(int num){
        num = 200;
    }
}
